public class demo5 {
    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(()->{
            for (int i = 0; i < 1000; i++) {
                System.out.println("正在执行 thread 线程");
            }
        });

        thread.start();

        //等待 0.1 s 就解除阻塞 main 线程,即不会继续等待了
        thread.join(1000);
        System.out.println("正在执行 main");
    }
}
